﻿<!DOCTYPE html>
@helper selected(string c, string culture)
 {
     if (c == culture)
     {
         @:checked="checked"
     }     
 }
@{
 var culture = System.Threading.Thread.CurrentThread.CurrentUICulture.Name.ToLowerInvariant();
 }
<html lang="it">
    <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta charset="utf-8" />
        <title>@ViewBag.Title </title>
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
        @Styles.Render("~/Content/css")
        @Scripts.Render("~/bundles/modernizr")
    </head>
    <body>
        <header>
            <div class="content-wrapper">
                <div class="float-left">
                    <p class="site-title">@Html.ActionLink("Inserire qui il logo", "Index", "Home")</p>
                </div>
                <div class="float-right">
                    <section id="login">
                        @Html.Partial("_LoginPartial")
                    </section>
                    <nav>
                        <ul id="menu">
                            <li>@Html.ActionLink("Home", "Index", "Home")</li>
                            <li>@Html.ActionLink("Informazioni", "About", "Home")</li>
                            <li>@Html.ActionLink("Contatto", "Contact", "Home")</li>
                        </ul>
                    </nav>
                </div>
            </div>
        </header>
        <div>
    @using (Html.BeginForm("SetCulture", "Home"))
    {
        <fieldset style="display:inline">
        <legend>Please choose your language</legend>
            <input name="culture" id="en-us" value="en-us" type="radio" @selected("en-us", culture) /> <label for="en-us">English</label> <br />
            <input name="culture" id="es-cl" value="es-cl" type="radio" @selected("it-IT", culture) /> <label for="es-cl">Italiano</label> <br />
        </fieldset>
    }

        </div>
        <div id="body">
            @RenderSection("featured", required: false)
            <section class="content-wrapper main-content clear-fix">
                @RenderBody()
            </section>
        </div>
        <footer>
            <div class="content-wrapper">
                <div class="float-left">
                    <p>&copy; @DateTime.Now.Year - Applicazione ASP.NET MVC</p>
                </div>
            </div>
        </footer>

        @Scripts.Render("~/bundles/jquery")
@*        <script src="~/Scripts/knockout-2.1.0.js"></script>
        <script src="~/Scripts/upshot.min.js"></script>
        <script src="~/Scripts/upshot.knockout.extensions.js"></script>*@

        @RenderSection("scripts", required: false)

        
    </body>

            <script type="text/javascript">
                $(function () {
                    $("input[type='radio']").click(function () {
                        $(this).parents("form").submit(); // apply by posting form
                    });

                    // highlight selected language
                    $("input[type='radio']:checked").next().css("font-weight", "bold");
                });
            </script>
</html>
